home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Music Architecture / Embedding Instruments / BigEasy / BigEasy2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-17  |  6.9 KB  |  258 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        BigEasy2.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1990-1992, 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     This file is used in these builds: Warhol
  11.  
  12.     Change History (most recent first):
  13.  
  14.         <24>     17-8-94    dvb        GX Printing
  15.         <23>      9-8-94    dvb        
  16.         <22>     27-7-94    dvb        InstallQuitItem
  17.         <21>     5/27/94    dvb        .
  18.         <18>      1/7/93    dvb        Built in window-copy command.
  19.         <17>     4/13/92    dvb        Pass activate/deactivates to back windows.
  20.         <16>     3/22/92    dvb        QuitApp message.
  21.         <15>     1/20/92    dvb        Cool new features. Easier AppleEvents.
  22.         <14>    12/19/91    JB        removing think 4.0 code
  23.         <13>     8/25/91    JB        Changed #def Ticks to #def GetTicks
  24.         <12>      6/3/91    dvb        Just hackin.
  25.         <11>     5/28/91    JB        Added prototypes for BigEasy Proc Ptrs
  26.         <10>     5/25/91    JB        OLD_THINK_C && TOOLBOX_LINKED
  27.          <9>     5/23/91    PH        functions..
  28.          <8>      5/5/91    dvb        App Open Events
  29.          <7>     4/25/91    JB        Changing to new THINK C interface files
  30.          <6>     4/19/91    dvb        Add WindowEventProc
  31.          <5>     2/24/91    dvb        Various cool new calls
  32.          <4>     2/18/91    dvb        Miscellaneous Updates
  33.          <3>      2/6/91    JB        Made nil #define conditional
  34.          <2>    11/17/90    dvb        Remove subport machinery
  35.          <4>     9/19/90    dvb        Fix graphics math collision
  36.          <3>     9/10/90    dvb        Take Zoomproc out of InstallWindow call.
  37.          <2>     7/31/90    dvb        Modify inclusion hierarchy
  38.  
  39.     To Do:
  40. */
  41.  
  42. /* file: BigEasy2.h
  43.  *
  44.  * Started 4 July 1989, more or less.
  45.  *
  46.  * A set of routines to allow the quick development
  47.  * of simple Macintosh applications.
  48.  *
  49.  */
  50.  
  51. #ifndef BigEasyIncludes
  52. #define BigEasyIncludes
  53.  
  54. #include <Types.h>
  55. #include <Menus.h>
  56. #include <Events.h>
  57. #include <Files.h>
  58.  
  59. /************************************
  60. * Simple things
  61. ************************************/
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif
  66.  
  67. typedef void (*beUpdateProcPtr)(short windowNum);        
  68. typedef void (*beClickProcPtr)(short windowNum, Point p, short modifiers);        
  69. typedef void (*beKeyProcPtr)(short windowNum, short key, short keycode, short modifiers);        
  70. typedef void (*beGoAwayProcPtr)(short windowNum);        
  71. typedef void (*beActivateProcPtr)(short windowNum);        
  72. typedef void (*beDeactivateProcPtr)(short windowNum);        
  73. typedef void (*beIdleProcPtr)(short windowNum, Boolean upfront);        
  74. typedef void (*beResizeProcPtr)(short windowNum, Point *oldSize, Point *newSize, short modifiers);        
  75. typedef void (*beGrowWindowProcPtr)(long *newSize, short windowNum,
  76.                         WindowPtr w, Point where, Rect *resizeLim);        
  77. typedef void (*beEventProcPtr)(short windowNum, EventRecord *event, Boolean *tookEvent);    
  78. typedef void (*beMoveWindowProcPtr)(short windowNum);    
  79. typedef void (*beMenuProcPtr)(short windowNum, short menuItem, short menuRef);
  80.  
  81. typedef void (*beAboutProcPtr)(void);        
  82. typedef void (*beWNumCallProcPtr)(short windowNum);
  83.  
  84. typedef void (*beOpenAppProcPtr)(void);
  85. typedef void (*beOpenDocProcPtr)(FSSpec *file);
  86. typedef void (*beQuitAppProcPtr)(void);
  87.  
  88. #ifdef __cplusplus
  89. }
  90. #endif
  91.  
  92.  
  93. #ifndef nil
  94.     #define nil (0L)
  95. #endif
  96.  
  97. #define SwapShort(a,b) {short temp; temp = a; a = b; b = temp;}
  98.  
  99.  
  100. /************************************
  101. * Types
  102. ************************************/
  103.  
  104. /*
  105.   * Window Flags (as passed to InstallWindow)
  106.   */
  107. typedef enum
  108.     {
  109.     wGrowable = 1,
  110.     wZoomable = 2,
  111.     wCoolDrag = 4,                /* Set to do the really cool live-dragwindow trick */
  112.     wCopyDraw = 8,                /* Enables Copy edit item, and uses DrawDoc to do it. */
  113.     wPrintDraw = 16                /* Enables Print & Page Setup via GX */
  114.     };
  115.  
  116. /*
  117.  * Built in menu ref-numbers
  118.  */
  119. typedef enum
  120.     {
  121.     mUndo = 30000,
  122.     mCut,
  123.     mCopy,
  124.     mPaste,
  125.     mClear,
  126.     mPageSetup,
  127.     mPrint
  128.     };
  129.  
  130. /************************************
  131. * BigEasy2 Public Global Variables
  132. ************************************/
  133. #ifdef BigEasy2
  134.     #define VAR
  135. #else
  136.     #define VAR extern
  137. #endif
  138.  
  139. VAR Boolean gQuitApp;
  140. VAR Boolean gMenuNeedsCmdKey;
  141. VAR Boolean gStaggerWindows;
  142. VAR Boolean gWindowsInView;
  143. VAR short gLastModifiers;
  144. VAR long gLastEventTime;
  145.  
  146. VAR long gSystemVersion;        /* for app to read */
  147. VAR Boolean gHasAppleEvents;    /* for app interest */
  148. VAR Boolean gHasColor;            /* for app interest */
  149. VAR Boolean gHasGX;                /* for everyone */
  150.  
  151. VAR Rect gBigRect;
  152.  
  153. VAR short gStagStepX;
  154. VAR short gStagStepY;
  155.  
  156. #ifndef __QUICKDRAW__
  157.     #include <QuickDraw.h>
  158. #endif
  159.  
  160. #ifndef __WINDOWS__
  161.     #include <Windows.h>
  162. #endif
  163.  
  164. #undef VAR
  165.  
  166.  
  167. /************************************
  168. * Major BigEasy2 Routines
  169. ************************************/
  170.  
  171. #ifdef __cplusplus
  172. extern "C" {
  173. #endif
  174.  
  175.  
  176. WindowPtr InstallWindow(short iNum,StringPtr iTitle,Rect *iRect,short iType,short newFlags,
  177.         beUpdateProcPtr iUpdate,beClickProcPtr iClick,beKeyProcPtr iKey,beGoAwayProcPtr iGoAway,
  178.         beActivateProcPtr iActivate,beDeactivateProcPtr iDeactivate,beIdleProcPtr iIdle);
  179.  
  180. void UninstallWindow(short iNum);
  181.  
  182. Boolean HandleUpdateEvent(EventRecord *er);
  183. Boolean HandleActivateEvent(EventRecord *er);
  184.  
  185.  
  186. void Show(short inum);
  187. void Hide(short iNum);
  188.  
  189. MenuHandle InstallMenu(StringPtr s,beMenuProcPtr action,short ref);
  190. void InstallMenuItem(StringPtr s,beMenuProcPtr action,short ref);
  191. void InstallQuitItem(beMenuProcPtr action,short ref);
  192.  
  193. void InstallPrintItems(beMenuProcPtr pageSetup,beMenuProcPtr print);
  194.  
  195. void RemoveMenuItem(short ref);
  196. void SetMenuItem(short ref,char enable,char isMarked,char mark,StringPtr s);
  197. void EnDisEdits(short Eundo,short Ecut,short Ecopy,short Epaste,short Eclear);
  198. void InstallEditMenu(beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr,beWNumCallProcPtr);
  199. MenuHandle SetCurrentMenu(short ref);
  200. long DisableAllMenus(void);
  201. void EnableAllMenus(long saveMenus);
  202.  
  203. void SetMasterIdle(beAboutProcPtr);
  204. void IdleWindow(short n);
  205.  
  206. void SetMasterOpenAppProc(beOpenAppProcPtr);
  207. void SetMasterOpenDocProc(beOpenDocProcPtr);
  208. void SetMasterQuitAppProc(beQuitAppProcPtr);
  209.  
  210. void SetWindowResizeProc(short n,beResizeProcPtr resizeProc);
  211. void SetWindowGrowWindowProc(short n,beGrowWindowProcPtr growWindowProc);
  212. void SetWindowZoomProc(short n,beWNumCallProcPtr iZoom);
  213. void SetWindowMoveProc(short n,beMoveWindowProcPtr moveWindowProc);
  214. void SetWindowEventProc(short n, beEventProcPtr iEvent);
  215. long GetWindowFlags(short n);
  216. void SetWindowFlags(short n,long flags);
  217.  
  218. void GetWindowRect(short n,Rect *r);
  219. WindowPtr GetWindowPtr(short n);
  220. Boolean GetWindowVisible(short n);
  221. void Replace1Resource(Handle,long type,short id);
  222. void SaveWindowPosition(short n);
  223. void ForgetWindowPosition(short n);
  224.  
  225. void SetAbout(StringPtr progName,StringPtr s0,beAboutProcPtr aboutProc);
  226.  
  227. void GoWatch(void);
  228. void GoArrow(void);
  229. void GoCursor(short c);
  230.  
  231. void FailNil(long);
  232. void FailOSErr(long);
  233.  
  234. /************************************
  235. * Client Provided BigEasy2 Routines
  236. ************************************/
  237.  
  238. void Bootstrap(void);
  239. void Hatstrap(void);
  240.  
  241. #ifdef __cplusplus
  242. }
  243. #endif
  244.  
  245.  
  246. /************************************
  247. * Minor BigEasy2 Hacks
  248. ************************************/
  249. #ifndef BigEasy2
  250.     #define FailNil(x)    FailNil((long)(x))                    /* Simulate a typeless call            */
  251.     #define FailOSErr(x)    FailOSErr((long)(x))            /* Simulate a typeless call            */
  252. #endif
  253.  
  254. #define GetTicks() (*(long *)Ticks)
  255.  
  256. #endif
  257.  
  258.